package main

import (
	"database/sql"
	"fmt"
	_ "github.com/go-sql-driver/mysql"
	"log"
)

func main() {
	conn, err := sql.Open(
		"mysql",
		"root:root2@tcp(172.20.0.10:3306)/gogogo",
	)
	if err != nil {
		log.Fatal("open conn error.", err)
	}
	defer conn.Close()
	fmt.Println(conn)
	err = conn.Ping()
	if err != nil {
		log.Fatal("conn db error.", err)
	}
}
